﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Elektronix.Class;

namespace Elektronix.admin
{
    public partial class siparisler : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            siparislerRepater.DataSource = Elektronix.Class.siparisler.siparislerigetir();
            siparislerRepater.DataBind();

            if (Request.QueryString["oid"]!= null)
            {   int id=Convert.ToInt32(Request.QueryString["oid"]);
                var a = Elektronix.Class.siparisler.siparislerigetirID(id);


                foreach (var item in a)
                {
                    txtEmail.Text = item.email;
                    txtFaturaAdresi.Text = item.kulfat;
                    txtFaturaAdresis.Text = item.invoiceaddres;
                    txtKargolamaTarihi.Text = item.shippeddate;
                    txtKargoSirketi.Text = item.shipvia.ToString();
                    txtNakliyeBedeli.Text = item.frieght.ToString();
                    txtNameSurname.Text = item.siparisveren;
                    txtOdemeYontemi.Text = item.odemeyontemi;
                    txtOrderID.Text = item.siparisID.ToString();
                    txtSiparistarihi.Text = item.orderdate;
                    txtStatus.Text = item.status.ToString();
                    txtTelefon.Text = item.telefon;
                    txtTeslimatAdresi.Text = item.shipaddres;
                    txtTeslimatAdresis.Text = item.kulteslimat;
                    txtTeslimatTarihi.Text = item.requireddate;
                    txtUserID.Text = item.userID.ToString();
                   
                }


                Repeater1.DataSource = Elektronix.Class.siparisler.detaylarigetir(id);
                Repeater1.DataBind();
            }


        }




    }
}